<template>
  <div class="left-content">
    <div class="serach-head">
      <div class="search-button" @click.stop="drawerVisible = true">
        <span class="btn-text">搜索</span>
        <i class="el-icon-arrow-down"></i>
      </div>
    </div>
    <div class="chat-account-list">
      <div class="account-item" v-for="i in 4" :key="index">
        <img class="account-cover" src="https://wework.qpic.cn/wwpic/64761_KTqc9qrgS9Cinq5_1696990323/0" />
        <div class="account-info">
          <div>
            <span class="account-name">闵雨微</span>
            <span class="company-name">@锐行</span>
          </div>
          <div class="describe">来自: 肖成红@志新</div>
        </div>
      </div>
    </div>
    <div class="drawer-model-wrap" v-show="drawerVisible">
      <div :class="['drawer-model-content', drawerVisible && 'open' ]">
        <div class="drawer-model-body">
          <div class="drawer-row-item">
            <div class="title">搜索客户/客户群：</div>
            <el-input size="small" placeholder="输入关键词" />
          </div>
          <div class="drawer-row-item">
            <div class="title">企微号：</div>
            <el-select v-model="value" placeholder="请选择" style="width: 100%;">
                <el-option
                  v-for="item in options"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
          </div>
          <div class="drawer-row-item">
            <div class="title">接入账号：</div>
            <el-select v-model="value" placeholder="请选择" style="width: 100%;">
                <el-option
                  v-for="item in options"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
          </div>
          <div class="drawer-row-item">
            <div class="title">接入时间：</div>
            <el-date-picker
              v-model="datetime"
              type="daterange"
              range-separator="至"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
              style="width: 100%;"
              >
            </el-date-picker>
          </div>
          <div class="drawer-row-item">
            <div class="title">会话类型：</div>
            <el-select v-model="value" placeholder="请选择" style="width: 100%;">
                <el-option
                  v-for="item in talkType"
                  :key="item.value"
                  :label="item.title"
                  :value="item.value">
                </el-option>
              </el-select>
          </div>
        </div>
        <div class="drawer-footer">
          <el-button plain style="width: 200px;" @click.stop="drawerVisible = false">清空全部</el-button>
          <el-button type="primary" plain style="width: 200px;" @click.stop="drawerVisible = false">搜索</el-button>
        </div>
      </div>
      <div class="drawer-model-mask" />
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      drawerVisible: false,
      formFilter: {},
      options: [],
      datetime: null,
      talkType: [
        {value: 1, title:'私聊'},
        {value: 2, title:'群聊'}
      ]
    }
  }
}
</script>
<style lang="scss" scoped>
.left-content {
  background: #f5f5f5;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
  width: 100%;
  position:relative;
  .serach-head {
    padding: 12px;
    font-size: 14px;
    line-height: 22px;
    .search-button {
      color: #3070ff;
      border: 1px solid #3070ff;
      text-shadow: none;
      width: 100%;
      height: 32px;
      background: rgb(255, 255, 255);
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 4px;
      .btn-text {
        margin-right: 6px;
      }
      i {
        font-size: 16px;
      }
    }
  }
  .chat-account-list {
    position: relative;
    z-index: 1;
    .account-item {
      padding: 12px;
      display: flex;
      align-items: center;
      cursor: pointer;
      .account-cover {
        width: 40px;
        height: 40px;
      }
      .account-info {
        margin-left: 12px;
        .account-name {
          font-size: 14px;
          color: #000;
          line-height: 20px;
        }
        .company-name {
          font-size: 12px;
          padding-left: 5px;
          color: #f90;
        }
        .describe {
          font-size: 12px;
          color: rgb(136, 137, 153);
          line-height: 16px;
          margin-top: 6px;
        }
      }
    }
  }
  .drawer-model-wrap {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    .drawer-model-content {
      position: relative;
      z-index: 2;
      overflow: auto;
      background-color: #fff;
      background-clip: padding-box;
      border: 0;
      height: 0;
      overflow: hidden; 
      &.open {
        height: 480px;
        box-shadow: 0 6px 16px -8px rgba(0,0,0,.08), 0 9px 28px 0 rgba(0,0,0,.05), 0 12px 48px 16px rgba(0,0,0,.03);
      }
      .drawer-model-body {
        padding: 32px 15px 15px;
        .drawer-row-item {
          margin-bottom: 15px;
          .title {
            margin-bottom: 5px;
            font-size: 14px;
            color: rgba(0,0,0,.85);
          }
        }
      }
      .drawer-footer {
        padding: 10px 16px;
        border-top: 1px solid #e9e9e9;
        display: flex;
        align-items: center;
        justify-content: space-between;
      }
    }
    .drawer-model-mask {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background-color: rgba(0,0,0,.45);
      z-index: 1;
    }
  }
}
</style>